package com.chinasofti.parems;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Demo02 {
    public static void main(String[] args) {
        List<String> list = List.of("a","b");
//        list.add("Q");
//        list.remove("a");
//        list.set(0,"A");
//        method1(list);

//        method2();
        Map<String,String> map = Map.ofEntries(Map.entry("张飒","江苏"),Map.entry("李四","南京"));
        System.out.println(map);
    }


    private static void method2() {
        Map<String,String> map = Map.of("吉林","吉林","北京","北京");
        System.out.println(map);
    }

    private static void method1(List<String> list) {
        System.out.println(list);
        ArrayList<String> arrayList = new ArrayList<>(List.of("a","b","c")); //List.of可变类型参数
        System.out.println(arrayList);
    }
}
